import {Route} from "react-router";
import DataView from "../components/data";
import AppDesigner from "../components/designer";
import BoardWidgetEditor from "../components/designer/analysis/BoardWidgetEditor";
import DataBoardWidget from "../components/designer/analysis/DataBoardWidget";
import FormPreview from "../components/designer/form/preview";
import {ExcelPage, TaskView} from '../components/task'
import ExcelTemplateView from "../components/excel-template/TemplateView";
import Home from '../components/Home';
import {WeaLocaleProvider} from 'ecCom';

const getLocaleLabel = WeaLocaleProvider.getLocaleLabel.bind(this, 'edc');

export default (
    <Route path="edc_v2" onEnter={getLocaleLabel} component={Home} >
        <Route path='designer/:appid' component={AppDesigner} />
        <Route path='widget/chart/:actionType(/:id)' component={BoardWidgetEditor} />
        <Route path='form/preview/:appid' component={FormPreview} />
        <Route path='view' component={TaskView} />
        <Route path='excel' component={ExcelPage} />
        <Route path='data' component={DataView} />
        <Route path='dataBoard' component={DataBoardWidget} />
        <Route path='exceltemplate/view' component={ExcelTemplateView} />
        <Route path='noRight' component={() => <div style={{ textAlign: "center", paddingTop: 100, color: '#ccc', fontSize: 24 }}>
            <i className="icon-coms-locking"></i>
            <div style={{ fontSize: 16 }}>没有权限</div>
        </div>} />
    </Route>
);